# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=belcard
pkgver=5.1.32
pkgrel=0
pkgdesc="C++ library to manipulate VCard standard format"
url="https://linphone.org"
arch="all"
license="GPL-3.0-or-later"
options="!check" # not test available
makedepends="cmake bctoolbox-dev belr-dev"
subpackages="$pkgname-dev"
source="https://www.linphone.org/releases/sources/belcard/belcard-$pkgver.tar.gz"
source="$pkgname-$pkgver.tar.gz::https://github.com/BelledonneCommunications/belcard/archive/$pkgver.tar.gz"

build() {
	cmake -B build . \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_MODULE_PATH=/usr/lib/cmake \
		-DCMAKE_INSTALL_DATADIR=share \
		-DENABLE_STRICT=NO \
		-DENABLE_SHARED=YES \
		-DENABLE_STATIC=NO \
		-DENABLE_UNIT_TESTS=NO
	make -C build
}

package() {
	make -C build DESTDIR="$pkgdir" install
}

dev() {
	default_dev
	mkdir -p "$subpkgdir"/usr/lib/cmake/belcard
	mv "$pkgdir"/usr/share/belcard/cmake/* "$subpkgdir"/usr/lib/cmake/belcard
}


sha512sums="
bcd2536045cf7d7c521db7b505fcaf3ff2f17658df096bcc5b579abec0b9f25a4a35327fe49372e41a5c2b57baaa9c51546c0daa53f46ee03f5351bd1c535d37  belcard-5.1.32.tar.gz
"
